package com.zhuiyun.project.api.archives.controller;

import com.zhuiyun.project.annotation.OptLog;
import com.zhuiyun.project.api.archives.entity.ArchivesModel;
import com.zhuiyun.project.api.archives.service.ArchivesService;
import com.zhuiyun.project.common.response.CommonResult;
import com.zhuiyun.project.utils.constants.CommonConstants;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName ArchivesController
 * @Description TODO
 * @Author 田
 * @Date 2024/2/26 14:05
 **/
@RestController
@RequestMapping("/Archives")
@Api(tags = "个人档案控制层")
@Slf4j
public class ArchivesController {

    @Autowired
    private ArchivesService archivesService;

    /**
    * @Author 田 
    * @Description 查询个人档案信息
    * @Date 2024/3/8 9:02
    * @Return com.zhuiyun.project.common.response.CommonResult
    * @param id
    */
    @ApiOperation(value = "查询个人档案信息")
    @OptLog(modular = "个人档案",type = CommonConstants.SELECT,describe = "查询个人档案")
    @GetMapping("/selectArticle")
    public CommonResult selectArchives(String id){
        return CommonResult.ok(archivesService.selectArchives(id));
    }
    
    /**
    * @Author 田
    * @Description 修改个人档案
    * @Date 2024/3/12 18:52
    * @Return
    * @return
    */
    @ApiOperation(value = "修改个人档案")
    @OptLog(modular = "个人档案",type = CommonConstants.ADD,describe = "修改个人档案")
    @PostMapping("/updateArchives")
    public boolean updateArchives(@RequestBody ArchivesModel archivesModel){
        return archivesService.updateArchives(archivesModel);
    }

}